board = [[13,11,10,4,7],
         [13,10,10,8,5],
         [5,9,7,7,4],
         [15,12,10,11,5],
         [10,11,8,8,4]]

ans_l = []
worker_l = [list(range(1,6))]
progress_l = [list(range(1,6))]


def best(progress_l_done , progress_l_remain , worker_l_working , worker_l_spare):
    global ans_l
    this_progress_l_done = progress_l_done[:]
    this_progress_l_remain = progress_l_remain[:]
    this_worker_l_working = worker_l_working[:]
    this_worker_l_spare = worker_l_spare[:]
    if len(this_progress_l_remain) == 1:
        ans_l.append([this_worker_l_working + this_worker_l_spare , this_progress_l_done + this_progress_l_remain])
    for i in range(0,len(this_worker_l_spare)):
        for j in range(0,len(this_progress_l_remain)):
            this_progress_l_done.append(this_progress_l_remain[j])
            this_progress_l_remain.pop(j)
            this_worker_l_working.append(this_worker_l_spare[i])
            this_worker_l_spare.pop(i)
            best(this_progress_l_done , this_progress_l_remain , this_worker_l_working , this_worker_l_spare)
            
            
best([],progress_l,[],worker_l)
ss_l = []
for i in range(0,len(ans_l)):
    ss_l.append(ans_l[i][1])
print(max(ss_l))